package cn.snmp.mutual.uk.stack;

public class DefaultAsnOctetsPrintable implements AsnOctetsPrintableFace {
    static final String version_id = "@(#)$Id: DefaultAsnOctetsPrintable.java,v 3.3 2006/01/17 17:43:54 birgit Exp $ Copyright Westhawk Ltd";

    public boolean isPrintable(final byte[] value) {
        final int length = value.length;
        final int b = 32;
        final int e = 126;
        boolean isPrintable = true;
        for (int i = 0; i < length && isPrintable; isPrintable = ((value[i] >= b && value[i] <= e) || Character.isWhitespace((char) value[i]) || value[i] == 0), ++i) {
        }
        return isPrintable;
    }

    public String toInternationalDisplayString(final byte[] value) {
        String str = "";
        if (value.length > 0) {
            str = new String(value).trim();
        }
        return str;
    }
}
